package cloud.shyidong.core.request;

/**
 * @Description TODO
 * @Author syd
 * @Date 2023/3/27
 */
public class SimplePageRequest implements PageRequest {
    
    private Integer status;
    
    private String createTimeStart;
    
    private String createTimeEnd;
    
    private String order;
    
    private String prop;
    
    private long current = 1;
    
    private long size = 10;
    
    @Override
    public long getCurrent() {
        if (current <= 0) {
            current = 1;
        }
        return current;
    }
    
    public void setCurrent(long current) {
        if (current > 1) {
            this.current = current;
        }
    }
    
    @Override
    public long getSize() {
        if (size <= 5) {
            size = 5;
        }
        return size;
    }
    
    public void setSize(long size) {
        if (size >= 5) {
            this.size = size;
        }
    }
    
    public long getStart() {
        return (this.getCurrent() - 1) * getSize();
    }
    
    public Integer getStatus() {
        return status;
    }
    
    public void setStatus(Integer status) {
        this.status = status;
    }
    
    public String getCreateTimeStart() {
        return createTimeStart;
    }
    
    public void setCreateTimeStart(String createTimeStart) {
        this.createTimeStart = createTimeStart;
    }
    
    public String getCreateTimeEnd() {
        return createTimeEnd;
    }
    
    public void setCreateTimeEnd(String createTimeEnd) {
        this.createTimeEnd = createTimeEnd;
    }
    
    public String getOrder() {
        return order;
    }
    
    public void setOrder(String order) {
        this.order = order;
    }
    
    public String getProp() {
        return prop;
    }
    
    public void setProp(String prop) {
        this.prop = prop;
    }
    
}
